#ifndef _INTERFACE_CAPTURA_H_
#define _INTERFACE_CAPTURA_H_

#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include "captura.h"

//#include <captura.h>

//#define DEBUG_SHOW_SERIALPORT_DATA

//#define VIDEO_TYPE RAW_VIDEO
#define INI_FILE "../capturar.ini"


#define USER "pedro"
//#define USER "depeca"
#define USER_GROUP "admin"



enum Enum_Page_Type {PAGE_CAPTURE=1,PAGE_AJUSTE=2};
enum Enum_Sync_External_Type{SYNC_EXTERNAL_ON=3,SYNC_EXTERNAL_OFF=4,SYNC_EXTERNAL_NULL=5};
enum Enum_Stereo_Type{	STEREO_ON=6,STEREO_OFF=7,STEREO_NULL=8};
enum Enum_Light_Adjustment_Type{LIGHT_ADJUSTMENT_ON=9,LIGHT_ADJUSTMENT_OFF=10,LIGHT_ADJUSTMENT_NULL=11};

#ifdef _MAIN_CPP_

char SHOW_WINDOW[2][20] = {"Captura Der", "Captura Izq"};
char VIDEOS_PATHS[2][100];

// Variables globales que van a ser utilizadas por los dos hilos
//
bool esta_grabando;
bool offset_flag;
bool grabar_flag;
bool iniciado_grabar;
Enum_Sync_External_Type external_sync[2];
Enum_Stereo_Type stereo_flag;

int light_intensity_value;
double gain_value;
double brightness_value;
double shutter_v; // Valor a transmitir en milisegundos

// Variables globales que sólo son utilizadas por un hilo
//
GdkDrawable *gdk_pixmap;
GdkDrawable *gdk_pixmap_ajuste;
int count;

GtkWidget *drawingarea_mplayer_gui;
GtkObject *adj_gan;
struct serial_params_t *p_Serial_Params;

int ptimer_left_image;
Enum_Page_Type page_name;
//FILE *pfile_write_video[2];

GtkWidget *window1;

serial_params_t serial_params;

bool external_sync_mode_on;
 
bool maximize_window, hold_window;

#else

extern int ptimer_left_image;

// Variables globales que van a ser utilizadas por los dos hilos
//
extern bool esta_grabando;
extern bool offset_flag;
extern bool grabar_flag;
extern bool iniciado_grabar;
extern Enum_Sync_External_Type external_sync[2];
extern Enum_Stereo_Type stereo_flag;

extern int light_intensity_value;
extern double gain_value;
extern double brightness_value;
extern double shutter_v; // Valor a transmitir en milisegundos


// Variables globales que sólo son utilizadas por un hilo
//
extern GdkDrawable *gdk_pixmap;
extern GdkDrawable *gdk_pixmap_ajuste;
extern int count;

extern GtkWidget *drawingarea_mplayer_gui;
extern GtkObject *adj_gan;
extern struct serial_params_t *p_Serial_Params;

extern int ptimer_left_image;
extern Enum_Page_Type page_name;
//extern FILE *pfile_write_video[2];

extern GtkWidget *window1;

extern bool external_sync_mode_on;
 
extern bool maximize_window, hold_window;

extern char SHOW_WINDOW[2][20];
extern char VIDEOS_PATHS[2][100];

#endif

int change_sched(pthread_t thread, int policy, int priority);


#endif
